package wp.ggt.com.wpview.activity;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import wp.ggt.com.wpview.R;
import wp.ggt.com.wpview.activity.BaseActivity;
import wp.ggt.com.wpview.view.SwitchView;

public class SwitchActivyt extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_switch_activyt);

    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    public void test(View view) {
        SwitchView switchView = (SwitchView) findViewById(R.id.swipe);
        Bitmap bitmap = Bitmap.createBitmap(switchView.getWidth(), switchView.getHeight(), Bitmap.Config.ARGB_8888);
        switchView.draw(new Canvas(bitmap));
        ImageView imageView = (ImageView) findViewById(R.id.iv_test);
        imageView.setImageBitmap(bitmap);
    }
}
